<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>props</title>
  </head>
  <body>
    <div id="test1"></div>
    <div id="test2"></div>
    <div id="test3"></div>
    <script
      src="https://unpkg.com/react@16/umd/react.production.min.js"
      crossorigin
    ></script>
    <script
      src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"
      crossorigin
    ></script>

    <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>

    <script type="text/babel">
      class Person extends React.Component {
        render() {
          console.log(this);
          const { name, age, sex } = this.props;
          return (
            <ul>
              <li>姓名:{name}</li>
              <li>性别:{age}</li>
              <li>年龄:{sex}</li>
            </ul>
          );
        }
      }

      ReactDOM.render(
        <Person name="张山" age="18" sex="女" />,
        document.getElementById("test1")
      );
      ReactDOM.render(
        <Person name="李四" age="19" sex="女" />,
        document.getElementById("test2")
      );
      ReactDOM.render(
        <Person name="王五" age="20" sex="女" />,
        document.getElementById("test3")
      );
    </script>
  </body>
</html>
